define(function(require) {
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var Model = function() {
		this.callParent();
	};


	Model.prototype.onNewsDetailCustomRefresh = function(event){
		var newsDetail = this.comp("newsDetail");
		$.ajax({
			url : this.getParentModel().serverUrl+"/ex_community/a/api/community/getNewsById",
			async : false,
			cache : false,
			data : {
				"id" : this.params.id
			},
			dataType : "jsonp",
			jsonp : "callback",
			success : function(data) {
				newsDetail.loadData([data.data]);
				newsDetail.first();
			},
			error : function() {

				throw justep.Error.create("加载数据失败");
			}
		});
	};

	return Model;
});
